package com.mz.ozy.adapter;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.ImageView;

import com.mz.ozy.R;
import com.mz.ozy.utils.glideUtils.GlideUtils;

import java.util.List;

public class AppealPicAdapter extends BaseAdapter {
    private Context mContext;
    private List<String> mBeanList;

    public AppealPicAdapter(Context context, List<String> mBeanList) {
        this.mContext = context;
        this.mBeanList = mBeanList;
    }

    @Override
    public int getCount() {
        return mBeanList.size();
    }

    @Override
    public Object getItem(int position) {
        return mBeanList.get(position);
    }

    @Override
    public long getItemId(int position) {
        return position;
    }

    @Override
    public View getView(int position, View convertView, ViewGroup parent) {
        View view = LayoutInflater.from(mContext).inflate(R.layout.item_appeal_pic, null);
        ImageView appealPicIv = view.findViewById(R.id.appealPicIv);
        String appealPic = mBeanList.get(position);
        GlideUtils.loadImg(mContext, appealPicIv, appealPic, R.mipmap.pic_default_appeal);
        return view;
    }
}
